limit = int(input("找寻目标数量内所有的水仙花数:"))
array = []
for i in range(1,limit+1):
    digits = [x for x in str(i)]
    total = 0
    for j in digits:
        total += int(j)**len(digits)
    if total == i:
        array.append(i)
print(array)